﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Zhp.Api.Attributes;
using Zhp.Api.Controllers.Sys;
using Zhp.Service.Workflow.Notify;

namespace Zhp.Api.Controllers.Hangfire
{
    [AllowAnonymous]
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class JobController : ControllerBase
    {
        private readonly ILogger<IndexController> _logger;
        private readonly IApproveNotifyService _approveNotifySvc;
        private readonly IApproveTodoService _approveTodoSvc;
        public JobController(ILogger<IndexController> logger, IApproveNotifyService approveNotifySvc, IApproveTodoService approveTodoSvc)
        {
            _logger = logger;
            _approveNotifySvc = approveNotifySvc;
            _approveTodoSvc = approveTodoSvc;
        }

        [NotAuditLog]
        [HttpGet]
        public async Task WorkflowNotify()
        {
            await _approveNotifySvc.SendNotify();
        }

        [NotAuditLog]
        [HttpGet]
        public async Task WorkflowTodo()
        {
            await _approveTodoSvc.SendTodo();
        }
    }
}
